package 责任链模式例子;

/**
 * Created by lilei on 2016/3/24.
 *客户端
 */

public class Boss {
    private Worker worker;
    public static void main(String[] args) {
        Boss boss = new Boss();
        Worker c = new WorkerC(null);
        Worker b = new WorkerB(c);
        Worker a = new WorkerA(b);
        boss.setWorker(a);
        a.handle("workerC");
    }

    public Worker getWorker() {
        return worker;
    }

    public void setWorker(Worker worker) {
        this.worker = worker;
    }
}
